package com.wit.witmg.api;


import com.wit.witmg.service.ITEnergyMonitorService;
import com.wit.witmg.service.ITEquipService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author bob
 * @since 2025-06-12
 */
@RestController
@RequestMapping("energy")
@Api(tags = "能耗监测API")
public class EnergyMonitorController {
    @Resource
    private ITEnergyMonitorService service;

    @ApiOperation("添加")
    @PostMapping("add")
    public Object add(HttpServletRequest request,
                      @RequestParam("json") String json) {
        return service.add(request,json);
    }

    @ApiOperation("获取")
    @PostMapping("get")
    public Object get(HttpServletRequest request,
                      @RequestParam(value = "mid",required = false) String mid,
                      @RequestParam(value = "dbn",required = false) String dbn,
                      @RequestParam(value = "pbn",required = false) String pbn,
                      @RequestParam(value = "dt0",required = false) Long dt0,
                      @RequestParam(value = "dt1",required = false) Long dt1) {
        return service.get(request,mid,dbn,pbn,dt0,dt1);
    }
}
